unit APIErrorResponseForm;

interface

uses
  Windows,
  Messages,
  SysUtils,
  Variants,
  Classes,
  Graphics,
  Controls,
  Forms,
  Dialogs,
  StdCtrls,
  uTaoBaoAPI,
  uTaoBaoManager,
  uTaoBaoTask;

type
  TfrmAPIErrorResponse = class(TForm)
    Label1: TLabel;
    edtAPICaption: TEdit;
    Label2: TLabel;
    edtAPIMethod: TEdit;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    edtCode: TEdit;
    edtMsg: TEdit;
    edtSub_Code: TEdit;
    edtSub_Msg: TEdit;
    Button1: TButton;
  private
    { Private declarations }
  public
    { Public declarations }
  end;

procedure ShowAPIErrorReponse(AAPIItem: TTaoBaoAPIItem;AErrorResponse: TErrorResponse);

implementation

var
  frmAPIErrorResponse: TfrmAPIErrorResponse;

{$R *.dfm}

procedure ShowAPIErrorReponse(AAPIItem: TTaoBaoAPIItem;AErrorResponse: TErrorResponse);
begin
  if frmAPIErrorResponse=nil then
  begin
    frmAPIErrorResponse:=TfrmAPIErrorResponse.Create(Application);
  end;
  frmAPIErrorResponse.edtAPICaption.Text:=AAPIItem.Caption;
  frmAPIErrorResponse.edtAPIMethod.Text:=AAPIItem.APIMethod;
  frmAPIErrorResponse.edtCode.Text:=IntToStr(AErrorResponse.Code);
  frmAPIErrorResponse.edtMsg.Text:=AErrorResponse.Msg;
  frmAPIErrorResponse.edtSub_Code.Text:=AErrorResponse.Sub_Code;
  frmAPIErrorResponse.edtSub_Msg.Text:=AErrorResponse.Sub_Msg;

  frmAPIErrorResponse.ShowModal;
end;

initialization
  frmAPIErrorResponse:=nil;

end.
